using System;
using System.Data;
using System.Collections.Generic;
using PPI.Entities.Interface;
using PPI.Mobile;
using VMind.Global;
using System.Text;

namespace PPI.ServiceLogic
{
	public class LXMissionStructures_TopType : IMobileTable
	{
        public LXMissionStructures_TopType()
        {
        }

        public static DataSet SelectAllIdName(string connectionKey)
        {
            return PPI.Data.DXMissionStructures_TopType.SelectAllIdName(connectionKey);
        }

        public static DataSet SelectAllIdNameByType(int  type,string connectionKey)
        {
            return PPI.Data.DXMissionStructures_TopType.SelectAllIdNameByType(type, connectionKey);
        }

	    public List<EMobileQuery> CreateInsertMobileQuery(string connectionKey)
	    {
            List<EMobileQuery> listQueries = new List<EMobileQuery>();
	        DataTable _Dt = SelectAllIdName(connectionKey).Tables[0];
            listQueries.Add(new EMobileQuery("Delete tb_Tops"));
            foreach (DataRow dr in _Dt.Rows)
            {
                listQueries.Add(new EMobileQuery("insert into tb_Tops (TopId,Name,VisitTypeFk)values (" + ConvertHelper.ToInt32(dr["XMissionStructures_TopTypeId"]) + ",'" + dr["Name"].ToString() + "'," + ConvertHelper.ToInt32(dr["Vendor_Visit_TypeID"]) + ")"));
            }
            return listQueries;
	    }
	}
}

